package net.crowdloud.shared.utilities;

import net.crowdloud.client.GlobalVariables;
import net.crowdloud.client.Home;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * 
 * @UserManual
 */
public class HomeIcon extends HTML {

	public HomeIcon() {

		this.setHTML("<a href='#'><img src='images/home.gif'></a>");

		this.setTitle("Home");

		this.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {

				String[] groupsArray = GlobalVariables.groups.split(",");

				RootPanel.get().clear();
				RootPanel.get().add(new Home(groupsArray));
			}
		});
	}
}
